<template>
    <rx-dialog @ok="handleSubmit" @cancel="cancel">
        <rx-layout>
            <template #middle>
				<a-form :model="config">
					<a-row>
						<a-col :span="12">
							<a-form-item :label="screenLangI18n('common.fieldLabel','字段备注')" style="width:85%">
								{{config.fieldLabel}}
							</a-form-item>
						</a-col>
						<a-col :span="12" v-if="type=='table'">
							<a-form-item :label="screenLangI18n('common.isRowSpan','是否纵向合并')">
								<a-checkbox v-model:checked="config.rowSpan" />
							</a-form-item>
						</a-col>
					</a-row>
					<a-row>
						<a-col :span="24">
							<a-form-item :label="screenLangI18n('common.sort','排序')">
								<a-radio-group v-model:value="config.sort">
									<a-radio value="default">{{screenLangI18n('common.default','默认')}}</a-radio>
									<a-radio value="DESC">{{screenLangI18n('common.desOrder','降序')}}(DESC)</a-radio>
									<a-radio value="ASC">{{screenLangI18n('common.ascOrder','升序')}}(ASC)</a-radio>
								</a-radio-group>
							</a-form-item>
						</a-col>
					</a-row>
				</a-form>
			</template>
		</rx-layout>
	</rx-dialog>
</template>

<script>
import {Util,RxLayout,RxDialog} from "@lowcode/jpaas-base-lib";

export default {
	name: "SettingDialog",
	props:['destroy',"settingConfig","type"],
	components:{
		RxLayout,
		RxDialog
	},
	data() {
		return {
			config:{
				fieldLabel:"",
				sort:"default",
				rowSpan:false,
			}
		}
	},
	created() {
		if(this.settingConfig){
			this.config=Object.assign(this.config,this.settingConfig);
		}
	},
	methods: {
		screenLangI18n(name,text,key){
			return this.$ti18(name,text,"screenLang",key);
		},
		handleSubmit() {
			Util.closeWindow(this, "ok",this.config);
		},
		cancel() {
			Util.closeWindow(this, "cancel");
		},
	},
	watch: {}
}
</script>

<style scoped>
</style>
